//
//  KEGameAnwserView.swift
//  KoalaEn
//
//  Created by Wade on 2024/10/29.
//

import Foundation
import SnapKit
import UIKit
import QMUIKit
class KEGameAnwserView:UIView{
    var contentView:UIView?
    
    var indexLabel:UILabel?
    
    var anwserBtn:QMUIButton?
    required init?(coder: NSCoder) {
        super.init(coder: coder)
        setupSubView()
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setupSubView()
    }
    
    
    func setupSubView(){
        let contentView = UIView()
        self.addSubview(contentView)
        contentView.backgroundColor = .cyan
        self.contentView = contentView
        contentView.snp.makeConstraints { make in
            make.edges.equalTo(self)
        }
        
        
        let indexLabel = UILabel()
        indexLabel.textColor = .black
        indexLabel.font = .systemFont(ofSize: 25)
        indexLabel.text = "A."
        contentView.addSubview(indexLabel)
        self.indexLabel = indexLabel
        indexLabel.snp.makeConstraints { make in
            make.centerY.equalTo(contentView)
            make.width.height.equalTo(40)
            make.left.equalTo(contentView)
        }
        
        let anwserBtn = QMUIButton()
        contentView.addSubview(anwserBtn)
        self.anwserBtn = anwserBtn
        anwserBtn.snp.makeConstraints { make in
            make.left.equalTo(indexLabel.snp.right).offset(10)
            make.width.height.equalTo(120)
            make.centerY.equalTo(contentView)
        }
    }
}
